# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Harley Laue <losinggeneration@yahoo.com>

pkgbase=anjuta
pkgname=('libanjuta' 'anjuta')
pkgver=3.22.0+1+g2bd433c
pkgrel=1
pkgdesc="GNOME Integrated Development Environment (IDE)"
arch=(i686 x86_64)
license=(GPL)
makedepends=(gdl vte3 autogen devhelp glade libgda subversion neon vala dconf gtk-doc yelp-tools gnome-common intltool gobject-introspection itstool gjs git)
url="http://www.anjuta.org/"
options=('!emptydirs')
_commit=2bd433c19394b9e2a04a41e2f2e5d89113627c40  # gnome-3-22
source=("git://git.gnome.org/anjuta#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgbase
  git describe --tags | sed 's/^ANJUTA_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgbase
  sed -i -e 's/\[0\.30\], \[0\.32\]/[0.30], [0.32], [0.34]/' configure.ac
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgbase

  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --enable-glade-catalog --enable-compile-warnings=minimum --enable-gtk-doc \
      PYTHON=/usr/bin/python2
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_libanjuta(){
  pkgdesc="Anjuta runtime library"
  depends=(gdl)
  conflicts=('anjuta<3.4.4')

  cd $pkgbase/libanjuta

  # j1: Race during linking
  make -j1 DESTDIR="$pkgdir" install
}

package_anjuta(){
  pkgdesc="GNOME Integrated Development Environment (IDE)"
  depends=(libanjuta vte3 autogen devhelp glade libgda subversion neon vala dconf)
  groups=('gnome-extra')

  cd $pkgbase
  make -j1 DESTDIR="$pkgdir" install

  cd libanjuta
  make -j1 DESTDIR="$pkgdir" uninstall
}
